<!DOCTYPE html>
<html>
<head>
	<link href="../demoengine/demoengine.min.css" rel="stylesheet">
	<script src="../demoengine/demoengine.min.js" defer></script>
	<title>jQuery UI Dialog: Hide the Close Button/Title Bar</title>
	<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/ui-darkness/jquery-ui.min.css" rel="stylesheet">
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
	<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>
	<style>
		.dlg-no-close .ui-dialog-titlebar-close {
			display: none;
		}
		.dlg-no-title .ui-dialog-titlebar {
			display: none;
		}
	</style>
</head>
<body>
	<div id="dialog1" title="Dialog 1">
		<p>This dialog has <code>.dlg-no-close</code> class applied to it. The close button is hidden via CSS.</p>
		<p>Press Esc to dismiss the dialog.</p>
	</div>
	<div id="dialog2" title="Dialog 2">
		<p>This dialog has <code>.dlg-no-title</code> class applied to it. The title bar is hidden via CSS.</p>
		<p>Press Esc to dismiss the dialog.</p>
	</div>
	<input type="button" id="button1" value="Open dialog 1">
	<input type="button" id="button2" value="Open dialog 2">
	<script>
		/*
		 * jQuery UI Dialog: Hide the Close Button/Title Bar
		 * http://salman-w.blogspot.com/2013/05/jquery-ui-dialog-examples.html
		 */
		$(function() {
			$("#dialog1").dialog({
				autoOpen: false,
				modal: true,
				dialogClass: "dlg-no-close"
			});
			$("#dialog2").dialog({
				autoOpen: false,
				modal: true,
				dialogClass: "dlg-no-title"
			});
			$("#button1").on("click", function() {
				$("#dialog1").dialog("open");
			});
			$("#button2").on("click", function() {
				$("#dialog2").dialog("open");
			});
		});
	</script>
</body>
</html>
